<%@ taglib prefix="s" 	uri="/struts-tags"%>
<%@ taglib prefix="c" 	uri="http://java.sun.com/jsp/jstl/core"%> 

	<link rel="stylesheet" href="styles/form-input.css" type="text/css" media="all" />
	<link type="text/css" rel="stylesheet" href="js/jquery/css/ui-lightness/jquery-ui-1.8.16.custom.css"/>
	<script type="text/javascript" src="js/jquery/jquery-1.6.2.min.js"></script>
	<script type="text/javascript" src="js/jquery/jquery-ui-1.8.16.custom.min.js"></script>
	<script type="text/javascript">
		$(function() { 
			$("#tdpExp").datepicker({ 	dateFormat: 'd MM, yy', changeMonth: true,	changeYear: true,  yearRange: '2000:2020' });
		});
		$(document).ready(function() {
    		$("button").button();
  		});
		function onlyNumbers(evt)
		{
		    var e = event || evt; // for trans-browser compatibility
		    var charCode = e.which || e.keyCode;

		    //if (charCode > 31 && ((charCode < 48 || charCode > 57) || charCode !=109))
		    if (charCode > 31 && (charCode < 48 || charCode > 57))
		        return false;

		    return true;
		}
		function notEmpty(address11,address12,address13,address14,address15,post1){
			if((address11.value.length == 0) && (address12.value.length != 0) && (address13.value.length != 0) && (address14.value.length != 0) && (address15.value.length != 0) && (post1.value.length != 0)){
				alert('Address 1 (domicile) : first row of address is mandatory');
				address11.focus();
				return false;
			}
			return true;
		}
		function notEmpty(){
			var address31 = document.getElementById('address31').value;
			var address32 = document.getElementById('address32').value;
			var address33 = document.getElementById('address33').value;
			var address34 = document.getElementById('address34').value;
			var address35 = document.getElementById('address35').value;
			var post3 = document.getElementById('post3').value;
			var address11 = document.getElementById('address11').value;
			var address12 = document.getElementById('address12').value;
			var address13 = document.getElementById('address13').value;
			var address14 = document.getElementById('address14').value;
			var address15 = document.getElementById('address15').value;
			var post1 = document.getElementById('post1').value;
			var address21 = document.getElementById('address21').value;
			var address22 = document.getElementById('address22').value;
			var address23 = document.getElementById('address23').value;
			var address24 = document.getElementById('address24').value;
			var address25 = document.getElementById('address25').value;
			var post2 = document.getElementById('post2').value;
			var address81 = document.getElementById('address81').value;
			var address82 = document.getElementById('address82').value;
			var address83 = document.getElementById('address83').value;
			var address84 = document.getElementById('address84').value;
			var address85 = document.getElementById('address85').value;
			var post8 = document.getElementById('post8').value;
			if((address31.length == 0) && ((address32.length != 0) || (address33.length != 0) || (address34.length != 0) || (address35.length != 0) || (post3.length != 0))){
				alert('Address 3 (primary) : first row of address is mandatory');
				document.getElementById('address31').focus();
	            return false;
			} if((address11.length == 0) && ((address12.length != 0) || (address13.length != 0) || (address14.length != 0) || (address15.length != 0) || (post1.length != 0))){
				alert('Address 1 (domicile) : first row of address is mandatory');
				document.getElementById('address11').focus();
	            return false;
			} if((address21.length == 0) && ((address22.length != 0) || (address23.length != 0) || (address24.length != 0) || (address25.length != 0) || (post2.length != 0))){
				alert('Address 2 (office) : first row of address is mandatory');
				document.getElementById('address21').focus();
	            return false;
			} if((address81.length == 0) && ((address82.length != 0) || (address83.length != 0) || (address84.length != 0) || (address85.length != 0) || (post8.length != 0))){
				alert('Address 8 (correspondence) : first row of address is mandatory');
				document.getElementById('address81').focus();
	            return false;
			} else {
				document.myform.submit();
				return true;
			};
		}
	</script>

	<div class="error-text"><s:actionerror /></div>
	<div class="error-text"><s:fielderror /></div>
	<div class="message-text"><s:actionmessage /></div>
	${areaName}
	<!-- <div>
		<table class="table-text">
			<tr><td><s:text name="rekening.no"/></td><td><s:property 	value="master.NO_REKENING"/></td></tr>
			<tr><td><s:text name="rekening.jenis"/></td><td><s:property value="master.JENIS_REKENING"/></td></tr>
			<tr><td><s:text name="rekening.nama"/></td><td><s:property 	value="master.NAMA_NASABAH"/></td></tr>
			<tr><td><s:text name="nasabah.tipe"/></td><td><s:property 	value="master.TIPE_NASABAH"/></td></tr>
		</table>
	</div>
	<br> -->
	<div>
        <div class="form-header">NASABAH NON INDIVIDUAL</div>
	  	<s:form name="myform" theme="simple" method="POST"  action="validateNonIndividu">
			<s:hidden name="masterSid" value="%{master.sid}"/>
			<%-- <s:submit type="button" action="fillMissData" >Completing</s:submit> --%>
      			<table class="table-form">
		    	<tr>
		            <td><label>CIF</label></td>
	            	<td><s:textfield value="%{master.CIF.cifSid}" size="6" maxlength="6" cssClass="textbox" disabled="true"/></td>
		        </tr>
		        <tr>
		            <td><label>CIF Open Date</label></td>
	            	<td><s:textfield value="%{OPEN_DATE}" disabled="true"/></td>
		        </tr>
		    	<tr>
		            <td><label>Nama Lengkap*</label></td>
	            	<td><s:textfield name="CUST_FULL_NAME" value="%{master.CIF.CUST_FULL_NAME}" size="50" maxlength="50" cssClass="textbox"/></td>
		        </tr>	            
<!-- PARENT_COUNTRY -->
				<tr>
	            	<td><label>Parent Country</label></td>
            		<td><s:select name="PARENT_COUNTRY" list="countryMap" value="%{master.CIF.PARENT_COUNTRY}" headerKey="" headerValue="Pilih Negara"/></td>
	            </tr>	
		        <tr>
		            <td><label>Akte Pendirian/AD TGL 1*</label></td>
	            	<td><s:textfield name="INFO_AKTE_PENDIRIAN" value="%{master.CIF.INFO_AKTE_PENDIRIAN}" size="35" maxlength="35" cssClass="textbox"/></td>
		        </tr>
		        <tr>
		            <td><label>Akte Pendirian/AD TGL 2*</label></td>
	            	<td><s:textfield name="INFO_AKTE_PENDIRIAN2" value="%{master.CIF.INFO_AKTE_PENDIRIAN2}" size="35" maxlength="35" cssClass="textbox"/></td>
		        </tr>
		        <tr>
		            <td><label>Akte Terakhir & Tanggal 1*</label></td>
	            	<td><s:textfield name="AKTE_TERAKHIR_TANGGAL1" value="%{master.CIF.AKTE_TERAKHIR_TANGGAL1}" size="35" maxlength="35" cssClass="textbox"/></td>
		        </tr>
		        <tr>
		            <td><label>Akte Terakhir & Tanggal 2*</label></td>
	            	<td><s:textfield name="AKTE_TERAKHIR_TANGGAL2" value="%{master.CIF.AKTE_TERAKHIR_TANGGAL2}" size="35" maxlength="35" cssClass="textbox"/></td>
		        </tr>
		        <tr>
		            <td><label>Surat Ijin Usaha dari Inst. Berwenang*</label></td>
	            	<td><s:textfield name="SIUP" value="%{master.CIF.SIUP}" size="35" maxlength="35" cssClass="textbox"/></td>
		        </tr>
		        <tr>
		            <td><label>Tanda Daftar Perusahaan</label></td>
	            	<td><s:textfield name="TDP" value="%{master.CIF.TANDA_DAFTAR_PERUSAHAAN}" size="35" maxlength="35" cssClass="textbox"/></td>
		        </tr>
		        <tr>
	            	<td><label>Tanggal Berakhir TDP*</label></td>
	        		<td><s:textfield id="tdpExp" name="TGL_AKHIR_TDP" value="%{TDP_EXP_DATE}" readonly="true"/></td>
	            </tr>
            	<tr>
		            <td><label>NPWP</label></td>
	            	<td><s:textfield name="NPWP" value="%{master.CIF.NPWP}" size="20" maxlength="20" cssClass="textbox"/></td>
		        </tr>
<!-- penghasilan -->
	            <tr>
	            	<td><label>Penghasilan*</label></td>
            		<td><s:select name="CURRENT_INCOME" list="currIncomeMap" value="%{master.CIF.CURRENT_INCOME}" headerKey="" headerValue="Pilih Penghasilan"/></td>
	            </tr>
<!-- sumber pendapatan -->
				<tr>
	            	<td><label>Sumber Pendapatan*</label></td>
            		<td><s:select name="SOURCE_INCOME" list="srcIncomeMap" value="%{master.CIF.SOURCE_INCOME}" headerKey="" headerValue="Pilih Sumber Pendapatan"/></td>
	            </tr>
<!-- additional income -->
				<tr>
	            	<td><label>Penghasilan Tambahan</label></td>
            		<td><s:select name="ADDITIONAL_INCOME" list="addIncomeMap" value="%{master.CIF.ADDITIONAL_INCOME}" headerKey="" headerValue="Pilih Penghasilan Tambahan"/></td>		            		
	            </tr>
<!-- tujuan -->
				<tr>
	            	<td><label>Tujuan Penggunaan*</label></td>
            		<td><s:select name="PURPOSE" list="purposeMap" value="%{master.CIF.PURPOSE}" headerKey="" headerValue="Pilih Tujuan Penggunaan"/></td>
	            </tr>
	            <tr>
	            	<td><label>Jenis Usaha Tempat Bekerja</label></td>
            		<td><s:textfield name="JENIS_USAHA" value="%{master.CIF.JENIS_USAHA}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
<!-- gol nasabah -->
				<tr>
	            	<td><label>Golongan Nasabah*</label></td>
            		<td><s:select name="LBU_GOL_NASABAH" list="golNasabahMap" value="%{master.CIF.LBU_GOL_NASABAH}" headerKey="" headerValue="Pilih Golongan Nasabah"/></td>	            		
	            </tr>
	            <tr>
	            	<td><label>Frekuensi Transaksi Debet*</label></td>
            		<td><s:textfield name="FREQ_TRX_DB" value="%{master.CIF.FREQ_TRX_DB}" size="18" maxlength="18" cssClass="textbox" onkeypress="return onlyNumbers();"/></td>
	            </tr>
	            <tr>
	            	<td><label>Frekuensi Transaksi Kredit*</label></td>
            		<td><s:textfield name="FREQ_TRX_CR" value="%{master.CIF.FREQ_TRX_CR}" size="18" maxlength="18" cssClass="textbox" onkeypress="return onlyNumbers();"/></td>
	            </tr>
	            <tr>
	            	<td><label>Average Transaksi Debet*</label></td>
            		<td><s:textfield name="EST_TRX_NORMAL_DB" value="%{master.CIF.EST_TRX_NORMAL_DB}" size="18" maxlength="18" cssClass="textbox" onkeypress="return onlyNumbers();"/></td>
	            </tr>
	            <tr>
	            	<td><label>Average Transaksi Kredit*</label></td>
            		<td><s:textfield name="EST_TRX_NORMAL_CR" value="%{master.CIF.EST_TRX_NORMAL_CR}" size="18" maxlength="18" cssClass="textbox" onkeypress="return onlyNumbers();"/></td>
	            </tr>          
	            <tr>
	            	<td><label>Rekening di Bank Lain 1</label></td>
            		<td><s:textfield name="NOREK_BANK_LAIN1" value="%{master.CIF.REK_BANK_LAIN1}" size="20" maxlength="20" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td><label>Rekening di Bank Lain 2</label></td>
            		<td><s:textfield name="NOREK_BANK_LAIN2" value="%{master.CIF.REK_BANK_LAIN2}" size="20" maxlength="20" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td><label>Rekening di Bank Lain 3</label></td>
            		<td><s:textfield name="NOREK_BANK_LAIN3" value="%{master.CIF.REK_BANK_LAIN3}" size="20" maxlength="20" cssClass="textbox"/></td>
	            </tr>	
<!-- hr business -->
				<tr>
	            	<td><label>High Risk Business</label></td>
            		<td><s:select name="HR_BUSINESS" list="hrBussMap" value="%{master.CIF.HR_BUSINESS}" headerKey="" headerValue="Pilih HR Bussiness"/></td>		            		
	            </tr>	            		            
<!-- hr country -->
				<tr>
	            	<td><label>High Risk Country</label></td>
            		<td><s:select name="HR_COUNTRIES" list="hrCountryMap" value="%{master.CIF.HR_COUNTRIES}" headerKey="" headerValue="Pilih HR Country"/></td>	            		
	            </tr>
<!-- hr customer -->
				<tr>
	            	<td><label>High Risk Customer</label></td>
            		<td><s:select name="HR_CUSTOMER" list="hrCstMap" value="%{master.CIF.HR_CUSTOMER}" headerKey="" headerValue="Pilih HR Customer"/></td>		            		
	            </tr>
<!-- hr product -->    
				<tr>
	            	<td><label>High Risk Product</label></td>
            		<td><s:select name="HR_PRODUCT" list="hrProductMap" value="%{master.CIF.HR_PRODUCT}" headerKey="" headerValue="Pilih HR Product"/></td>		            		
	            </tr>
<!-- lap. keuangan -->
				<tr>
	            	<td><label>Laporan Keuangan*</label></td>
            		<td><s:select name="LAP_KEUANGAN" list="lapKeuMap" value="%{master.CIF.LAP_KEUANGAN}" headerKey="" headerValue="Pilih Lap. Keuangan"/></td>		            		
	            </tr>
<!-- hub. dgn bank -->
				<tr>
	            	<td><label>Hubungan Dengan Bank*</label></td>
            		<td><s:select name="HUB_DENGAN_BANK" list="hubBankMap" value="%{master.CIF.HUB_DENGAN_BANK}" headerKey="" headerValue="Pilih Hub. Dengan Bank"/></td>		            		
	            </tr>
            </table>
            <br>
            <strong>First row of address is mandatory</strong><br>
            <table class="table-form">
            	<tr>
	            	<td width="308px"><label>Prime Address (KTP)*</label></td>
					<td colspan="2"><s:textfield id="address31" name="destAddress.address31" value="%{srcAddress.address31}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address32" name="destAddress.address32" value="%{srcAddress.address32}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address33" name="destAddress.address33" value="%{srcAddress.address33}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address34" name="destAddress.address34" value="%{srcAddress.address34}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address35" name="destAddress.address35" value="%{srcAddress.address35}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td>Post Code&nbsp;&nbsp;&nbsp;<s:textfield id="post3" name="destAddress.postCode3" value="%{srcAddress.postCode3}" size="6" maxlength="6" cssClass="textbox"/></td>
	            </tr>
	            <tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
				<tr>
	            	<td><label>Address 1 (domicile)</label></td>
					<td colspan="2"><s:textfield id="address11" name="destAddress.address11" value="%{srcAddress.address11}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address12" name="destAddress.address12" value="%{srcAddress.address12}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address13" name="destAddress.address13" value="%{srcAddress.address13}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address14" name="destAddress.address14" value="%{srcAddress.address14}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address15" name="destAddress.address15" value="%{srcAddress.address15}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td>Post Code&nbsp;&nbsp;&nbsp;<s:textfield id="post1" name="destAddress.postCode1" value="%{srcAddress.postCode1}" size="6" maxlength="6" cssClass="textbox"/></td>
	            </tr>
				<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
				<tr>
	            	<td><label>Address 2 (office)</label></td>
					<td colspan="2"><s:textfield id="address21" name="destAddress.address21" value="%{srcAddress.address21}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address22" name="destAddress.address22" value="%{srcAddress.address22}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address23" name="destAddress.address23" value="%{srcAddress.address23}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address24" name="destAddress.address24" value="%{srcAddress.address24}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address25" name="destAddress.address25" value="%{srcAddress.address25}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td>Post Code&nbsp;&nbsp;&nbsp;<s:textfield id="post2" name="destAddress.postCode2" value="%{srcAddress.postCode2}" size="6" maxlength="6" cssClass="textbox"/></td>
	            </tr>
				<tr></tr><tr></tr><tr></tr><tr></tr><tr></tr>
				<tr>
	            	<td><label>Address 8 (correspondence)</label></td>
					<td colspan="2"><s:textfield id="address81" name="destAddress.address81" value="%{srcAddress.address81}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address82" name="destAddress.address82" value="%{srcAddress.address82}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address83" name="destAddress.address83" value="%{srcAddress.address83}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address84" name="destAddress.address84" value="%{srcAddress.address84}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td colspan="2"><s:textfield id="address85" name="destAddress.address85" value="%{srcAddress.address85}" size="35" maxlength="35" cssClass="textbox"/></td>
	            </tr>
	            <tr>
	            	<td></td><td>Post Code&nbsp;&nbsp;&nbsp;<s:textfield id="post8" name="destAddress.postCode8" value="%{srcAddress.postCode8}" size="6" maxlength="6" cssClass="textbox"/></td>
	            </tr>           	
            </table>
	        <br>
	        <br>
	        <button type="button" onclick="notEmpty();">submit</button>
	        <button type="button" onclick="window.location.href='checklist'">cancel</button>
        </s:form>
	</div>